home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Linux / Kubuntu 8.10 / kubuntu-8.10-desktop-i386.iso / casper / filesystem.squashfs / usr / bin / ps2pdfwr < prev    next >
Text File  |  2008-10-20  |  1KB  |  46 lines

  1. #!/bin/sh
  2. # $Id: ps2pdfwr 8107 2007-07-05 19:04:29Z till $
  3. # Convert PostScript to PDF without specifying CompatibilityLevel.
  4.  
  5. # This definition is changed on install to match the
  6. # executable name set in the makefile
  7. GS_EXECUTABLE=gs
  8. gs="`dirname $0`/$GS_EXECUTABLE"
  9. if test ! -x "$gs"; then
  10.     gs="$GS_EXECUTABLE"
  11. fi
  12. GS_EXECUTABLE=gs
  13.  
  14. OPTIONS="-dSAFER"
  15. while true
  16. do
  17.     case "$1" in
  18.     -?*) OPTIONS="$OPTIONS $1" ;;
  19.     *)  break ;;
  20.     esac
  21.     shift
  22. done
  23.  
  24. if [ $# -lt 1 -o $# -gt 2 ]; then
  25.     echo "Usage: `basename $0` [options...] (input.[e]ps|-) [output.pdf|-]" 1>&2
  26.     exit 1
  27. fi
  28.  
  29. infile="$1";
  30.  
  31. if [ $# -eq 1 ]
  32. then
  33.     case "${infile}" in
  34.       -)        outfile=- ;;
  35.       *.eps)    base=`basename "${infile}" .eps`; outfile="${base}.pdf" ;;
  36.       *.ps)        base=`basename "${infile}" .ps`; outfile="${base}.pdf" ;;
  37.       *)        base=`basename "${infile}"`; outfile="${base}.pdf" ;;
  38.     esac
  39. else
  40.     outfile="$2"
  41. fi
  42.  
  43. # We have to include the options twice because -I only takes effect if it
  44. # appears before other options.
  45. exec "$GS_EXECUTABLE" $OPTIONS -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite "-sOutputFile=$outfile" $OPTIONS -c .setpdfwrite -f "$infile"
  46.